package com.woniuxy.booth.mapper;

import com.woniuxy.booth.bean.RoleBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author linke
 * @version 1.0
 * @className: RoleMapper
 * @description: 角色持久层接口
 * @date 2021/11/15 1:18
 */
public interface RoleMapper {

    /**
     * 查询所有的角色
     * @return
     */
    @ResultType(RoleBean.class)
    @Select("select id,role_name as roleName from role_info where status = 0")
    List<RoleBean> findAll();


    @ResultType(RoleBean.class)
    @Select("select id,role_name as roleName from role_info where status = 0 and id = #{id}")
    RoleBean getOneById(@Param("id") Long id);

}
